﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Stema.Controls;
using System.Collections.ObjectModel;

namespace OutlookNavigationPanelTest
{
 public partial class Window1 : Window
 {


  public ObservableCollection<Table> Data
  {
   get { return (ObservableCollection<Table>)GetValue(DataProperty); }
   set { SetValue(DataProperty, value); }
  }

  // Using a DependencyProperty as the backing store for Data.  This enables animation, styling, binding, etc...
  public static readonly DependencyProperty DataProperty =
      DependencyProperty.Register("Data", typeof(ObservableCollection<Table>), typeof(Window1), new UIPropertyMetadata(null));

  
  public ObservableCollection<Table> data;
  public Window1()
  {
   InitializeComponent();
   Data = GenerateTestContent();
  }

  private ObservableCollection<Table> GenerateTestContent()
  {
   ObservableCollection<Table> result = new ObservableCollection<Table>();

   List<string> rows;
   Table t;

   for (int i = 1; i < 5; i++)
   {
    rows = new List<string>();
    t = null;

    for (int j = 1; j < 10; j++)
    {
     rows.Add(string.Format("Table #{0} - Row #{1}", i.ToString(), j.ToString()));
    }

    t = new Table(string.Format("Table #{0}", i.ToString()), rows);

    if (t != null)
     result.Add(t);
   }

   return result;
  }
 }
 public class Table
 {
  private string _Name = "";
  private List<string> _Rows = new List<string>();

  public string Name
  {
   get { return _Name; }
   set { _Name = value; }
  }

  public List<string> Rows
  {
   get { return _Rows; }
   set { _Rows = value; }
  }

  public Table(string aName, List<string> aRows)
  {
   Name = aName;
   Rows = aRows;
  }

 }
}

